package db_model

import (
	"time"
)

// File represents the files table structure
type File struct {
	ID           string    `json:"id" gorm:"type:uuid;primaryKey;default:gen_random_uuid()"`
	Type         int16     `json:"type" gorm:"type:smallint;not null;default:1"`
	Data         string    `json:"data" gorm:"type:text;not null"`
	OriginalName *string   `json:"original_name,omitempty" gorm:"type:text"`
	CreatedAt    time.Time `json:"created_at" gorm:"type:timestamptz;not null;default:CURRENT_TIMESTAMP"`
}

// TableName specifies the table name
func (File) TableName() string {
	return "files"
}
